<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" indent="yes" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
                doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
                omit-xml-declaration="yes"/>
    <xsl:variable name="layout"/>

    <xsl:template match="/">
        <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
            <head>
                <xsl:call-template name="html-head-before"/>
                <xsl:call-template name="html-head-standard"/>
                <xsl:call-template name="html-head-after"/>
            </head>

            <body>
                <xsl:call-template name="after-body-start"/>

                <!-- #content: holds all except site footer - causes footer to stick to bottom -->
                <div id="content">

                    <!-- #header: holds the logo and top links -->
                    <div id="header" class="width">
                        <xsl:call-template name="layout-header"/>
                    </div>
                    <!-- #header end -->

                    <!-- #headerImg: holds the main header image or flash -->
                    <div id="headerImg" class="width">
                        <span/>
                    </div>

                    <!-- #menu: the main large box site menu -->
                    <div id="menu" class="width">
                        <xsl:call-template name="layout-tab-menu"/>
                    </div>
                    <!-- #menu end -->

                    <!-- #page: holds the page content -->
                    <div id="page">
                        <!-- #columns: holds the columns of the page -->
                        <div id="columns" class="widthPad">
                            <xsl:choose>
                                <!-- Single column -->
                                <xsl:when test="$layout = '1col'">
                                    <div class="floatLeft width100">
                                        <xsl:call-template name="layout-left"/>
                                    </div>
                                </xsl:when>

                                <!-- 2 columns, left is narrow -->
                                <xsl:when test="$layout = '2col-narrow-left'">
                                    <div class="floatLeft width25">
                                        <xsl:call-template name="layout-left"/>
                                    </div>
                                    <div class="floatRight width75">
                                        <xsl:call-template name="layout-right"/>
                                    </div>
                                </xsl:when>

                                <!-- 2 columns, right is narrow -->
                                <xsl:when test="$layout = '2col-narrow-right'">
                                    <div class="floatLeft width73">
                                        <xsl:call-template name="layout-left"/>
                                    </div>
                                    <div class="floatRight width25 lightBlueBg horzPad">
                                        <xsl:call-template name="layout-right"/>
                                    </div>
                                </xsl:when>

                                <!-- 3 columns, left and right narrow -->
                                <xsl:when test="$layout = '3col'">
                                    <div class="floatLeft width25">
                                        <xsl:call-template name="layout-left"/>
                                    </div>
                                    <div class="floatLeft width50">
                                        <xsl:call-template name="layout-centre"/>
                                    </div>
                                    <div class="floatRight width25 lightBlueBg horzPad">
                                        <xsl:call-template name="layout-right"/>
                                    </div>
                                </xsl:when>

                                <xsl:otherwise>
                                    <xsl:text>The layout variable has not been set</xsl:text>
                                </xsl:otherwise>
                            </xsl:choose>
                        </div>
                        <!-- #columns end -->
                    </div>
                    <!-- #page end -->
                </div>
                <!-- #content end -->

                <!-- #footer: holds the site footer (logo and links) -->
                <div id="footer">
                    <!-- #bg: applies the site width and footer background -->
                    <div id="bg" class="width">
                        <xsl:call-template name="layout-footer"/>
                    </div>
                    <!-- #bg end -->
                </div>
                <!-- #footer end -->

                <xsl:call-template name="before-body-end"/>
            </body>
        </html>
    </xsl:template>

    <xsl:template name="layout-left">
        Override this to insert your content here!
    </xsl:template>

    <xsl:template name="layout-right">
        Override this to insert your content here!
    </xsl:template>

    <xsl:template name="layout-centre">
        Override this to insert your content here!
    </xsl:template>

    <xsl:template name="layout-header">
        Override this to insert your header here!
    </xsl:template>

    <xsl:template name="layout-tab-menu">
        Override this to insert your tab menu here!!
    </xsl:template>

    <xsl:template name="layout-footer">
        Override this to insert your footer here!!
    </xsl:template>

    <xsl:template name="html-head-before">
        <!--Override this to insert your head customisations-->
    </xsl:template>

    <xsl:template name="before-body-end">
    </xsl:template>

    <xsl:template name="after-body-start">
    </xsl:template>

    <xsl:template name="html-head-standard">
        <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8"/>
        <meta name="robots" content="index, follow, noarchive"/>
        <meta name="googlebot" content="noarchive"/>

        <link rel="stylesheet" type="text/css" href="css/layout.css" media="screen, projection, tv "/>
        <link rel="stylesheet" type="text/css" href="css/html.css" media="screen, projection, tv "/>
    </xsl:template>

    <xsl:template name="html-head-after">
        <!--Override this to insert your head customisations-->
    </xsl:template>

</xsl:stylesheet>
